﻿@model IEnumerable<Citi.HeadCount.WebUI.Models.TypeResultViewModel>
@{
    ViewBag.Title = "Index";
}
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    @foreach (var header in Model.OrderBy(m => m.TypeDescription).Select(m => m.TypeDescription).Distinct())
    {
        <tr>
            <th>Action</th>
            <th>@header</th>
        </tr>
            
        
        foreach (var item in Model.Where(m => m.TypeDescription == header))
        {
        <tr>
            <td>@Html.ActionLink("Delete", "Delete", "TypeResult", new { id = item.Id }, null)</td>
            <td>@item.Value</td>
        </tr>
        }
    }
</table>
